<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>校园Packer</title>
    <link rel="stylesheet" href="/css/lib/bootstrap.min.css">
    <link rel="stylesheet" href="/css/app.css">
    
  </head>
  <body>
    <header>
      <div class="clearfix">
        <div class="headerTitle">我校食堂后台管理系统</div><a class="btn btn-warning pull-right logout">注销</a><span class="pull-right headerText">欢迎您，<span id="role"></span><span id="name"></span></span>
      </div>
    </header>
    <div class="sidebar">
      <ul>
        <li class="toggleUl"><a>权限管理</a>
          <ul>
            <li class="subItem"><a href="/views/manager.html">查看管理员</a></li>
            <li class="subItem"><a href="/views/master.html">查看堂主</a></li>
            <li class="subItem"><a href="/views/courier.html">查看配送员</a></li>
          </ul>
        </li>
        <li class="toggleUl"><a>学校管理</a>
          <ul>
            <li class="subItem"><a href="/views/school_manage.html">学校管理</a></li>
            <li class="subItem"><a href="/views/canteen_manage.html">食堂管理</a></li>
          </ul>
        </li>
        <li class="toggleUl"><a>商品管理</a>
          <ul>
            <li class="subItem"><a href="/views/goods_manage.html">商品管理</a></li>
            <li class="subItem"><a href="/views/import_goods.html">导入商品</a></li>
          </ul>
        </li>
        <li class="toggleUl"><a>文件管理</a>
        </li>
        <li class="toggleUl"><a>财务管理</a>
        </li>
        <li class="toggleUl"><a>交易管理</a>
          <ul>
            <li class="subItem"><a href="/views/trade_manage.html">查看交易</a></li>
            <li class="subItem"><a href="/views/import_trade.html">导入交易</a></li>
          </ul>
        </li>
        <li class="toggleUl"><a href="/views/delivery_manage.html">发货管理</a>
        </li>
        <li class="toggleUl"><a href="/views/user_query.html">用户查询</a>
        </li>
        <li class="toggleUl"><a href="/views/trade_query.html">交易查询</a>
        </li>
        <li class="toggleUl"><a href="/views/goods_query.html">商品查询</a>
        </li>
        <li class="toggleUl"><a href="/views/order_query.html">订单查询</a>
        </li>
      </ul>
    </div>
    <title>校园Packer</title>
    <div class="rightSide">
      <div class="container-fluid">
        <div class="row">
          <form id="delivery" class="form form-inline">
            <label>学校</label>
            <select id="querySchool" class="form-control widthFixed"></select>
            <label class="marginLeft">状态</label>
            <select id="status" class="widthFixed">
              <option value="-1">全部</option>
              <option value="0">没有创建支付交易</option>
              <option value="1">等待买家付款</option>
              <option value="2">等待成团</option>
              <option value="3">等待卖家发货</option>
              <option value="4">等待买家确认收货</option>
              <option value="5">买家已签收</option>
              <option value="6">用户退款成功，交易自动关闭</option>
              <option value="7">用户关闭交易</option>
              <option value="8">所有关闭订单</option>
            </select>
            <label class="marginLeft">条数</label>
            <input id="page_size" type="number" value="100" class="widthFixed">
            <label>条</label>
            <label class="marginLeft">选择时间：
            </label>
            <input id="date_today" type="text" placeholder="日期" required class="datepicker date form_datetime controls widthFixed">
            <input id="start" type="text" placeholder="请选择开始时间" required class="datepicker date form_datetime controls time widthFixed">
            <label>至</label>
            <input id="end" type="text" placeholder="请选择结束时间" required class="datepicker date form_datetime controls time widthFixed">
            <button id="queryGoods" type="submit" class="btn btn-primary marginLeft">查询</button>
            <div id="tips" class="text-danger"></div>
          </form>
        </div>
        <div id="deliveryInfo" class="row">
          <div class="row"><a id="export_goodsSum" href="javascript:;" class="btn btn-primary btn">导出商品数量表</a></div>
          <div class="row"><a id="export_goodsInfo" class="btn btn-primary btn">导出商品详情表</a>
            <label for="status">
              <input type="checkbox" id="status_check" value="status">状态
            </label>
            <label for="created_time">
              <input type="checkbox" id="created_time" value="created_time">创建时间			
            </label>
          </div>
          <div class="row">
            <table id="goodsSumTable" class="table table-bordered table-hover">
              <caption class="h4 text-center">商品数量表</caption>
              <thead>
                <th>商品</th>
                <th>数量</th>
              </thead>
              <tbody id="goodsSum"></tbody>
            </table>
          </div>
          <div class="row text-right forcedVerticalCenter"><span>
               
              共<span id="goods_count"></span>条记录</span></div>
          <div class="row">
            <table id="goodsInfoTable" border="1" class="table table-bordered">
              <caption class="h4 text-center">商品详情表</caption>
              <thead>
                <th>序号</th>
                <th>商品</th>
                <th>数量</th>
                <th>收货人</th>
                <th>地址</th>
                <th>留言</th>
                <th>电话</th>
                <th>状态</th>
                <th>交易创建时间</th>
                <th>接单人</th>
                <th>配送状态</th>
              </thead>
              <tbody id="goodsInfo"></tbody>
              <tfoot id="send-orders">
                <tr>
                  <td>
                    <label class="orders-cursor orders-nowrap">ALL
                      <input id="getAll" type="checkbox" onclick="myFun.getAll()" class="orders-cursor">
                    </label>
                  </td>
                  <td colspan="1" class="send-btn">
                    <button id="pullOrder" type="button" class="btn btn-primary">发送订单</button>
                  </td>
                  <td id="sendBar" colspan="3">
                    <div class="progress progress-striped">
                      <div role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0" class="progress-bar progress-bar-success"></div>
                    </div><span class="success-num">0%</span>
                  </td>
                  <td id="sendResult" colspan="6"></td>
                </tr>
              </tfoot>
            </table>
          </div>
          <div class="row text-right forcedVerticalCenter"><span>
               
              共<span id="total"></span>条记录</span>
            <div id="paginator" class="paginator"></div>
          </div>
        </div>
      </div>
    </div>
    <link rel="stylesheet" href="/css/lib/bootstrap-datetimepicker.css">
    <link rel="stylesheet" href="/css/lib/select2.min.css">
    <script id="template_school" type="text/dot-tpl">{{~it:value:index}}
      <option value="{{=value.id}}">{{=value.name}}</option>{{~}}
    </script>
    <script id="template_canteen" type="text/dot-tpl">{{~it:value:index}}
      <option id="{{=value.id}}">{{=value.name}}</option>{{~}}
    </script>
    <script id="template_goodsSum" type="text/dot-tpl">{{~it:value}}
      <tr>
        <td>{{=value.item_name}}</td>
        <td>{{=value.count}}</td>
      </tr>{{~}}
    </script>
    <script id="template_goodsInfo" type="text/dot-tpl">
      {{~it:value:index}}
      {{for(var item in value.delivers){}}
      {{?item==0}}
      <tr>
        <td rowspan="{{=value.delivers.length}}" data-tradeid="{{=value.trade_id}}" class="ordersIndex orders-nowrap">
          <label class="orders-cursor">{{=index+1}}
            <input type="checkbox" class="orders-cursor">
          </label>
        </td>
        <td class="itemName">{{=value.delivers[item].item_name}}</td>
        <td class="itemCount">{{=value.delivers[item].count}}</td>
        <td class="receiverName">{{=value.receiver_name}}</td>
        <td rowspan="{{=value.delivers.length}}" class="receiverAddress">{{=value.receiver_address}}</td>
        <td rowspan="{{=value.delivers.length}}" class="message">{{=value.message}}</td>
        <td rowspan="{{=value.delivers.length}}" class="receiverTel">{{=value.receiver_mobile}}</td>
        <td rowspan="{{=value.delivers.length}}" class="status">{{=value.status}}</td>
        <td rowspan="{{=value.delivers.length}}" class="tradeTime">{{=value.created_time}}</td>
        <td rowspan="{{=value.delivers.length}}">{{=value.sender_name}}</td>
        <td rowspan="{{=value.delivers.length}}" class="sendStatus">{{=value.send_status}}</td>
      </tr>{{??}}
      <tr>
        <td class="{{=value.trade_id}}">{{=value.delivers[item].item_name}}</td>
        <td class="moreOrderCount">{{=value.delivers[item].count}}</td>
        <td>{{=value.receiver_name}}</td>
      </tr>{{?}}
      {{}}}
      {{~}}
    </script>
    <script id="template_progress" type="text/dot-tpl">
      <div class="progress progress-striped">
        <div role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: {{=it}}" class="progress-bar-info progress-bar progress-bar-success"></div>
      </div><span class="success-num"></span>
    </script>
    <script src="/js/lib/require.js" data-main="/js/delivery_manage"></script>
    <div id="noticeModal" class="modal fade">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-body">
            <h4 id="noticeMsg"></h4>
          </div>
          <div class="modal-footer">
            <button type="button" data-dismiss="modal" class="btn btn-primary">确定</button>
          </div>
        </div>
      </div>
    </div>
    <div id="confirmModal" class="modal fade">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-body">
            <h4 id="confirmMsg"></h4>
          </div>
          <div class="modal-footer">
            <button type="button" id="confirmBtn" class="btn btn-primary">确认</button>
            <button type="button" data-dismiss="modal" class="btn btn-default">取消</button>
          </div>
        </div>
      </div>
    </div>
    <div id="sendModal" aria-hidden="true" data-backdrop="data-backdrop" class="modal fade">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-body">
            <h4 id="sendMsg"></h4>
          </div>
          <div class="modal-footer">
            <button type="button" id="sendConfirm" class="btn btn-primary">确认</button>
            <button id="cancelOrder" type="button" data-dismiss="modal" class="btn btn-default">取消</button>
          </div>
        </div>
      </div>
    </div>
    <script src="/js/index.js"></script>
  </body>
</html>